package com.iotboss.common.context;

public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 从当前线程中存入id
     * @param id
     */
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    /**
     * 从当前线程中取id
     * @return
     */
    public static Long getCurrentId() {
        return threadLocal.get();
    }

    /**
     * 从当前线程中删除id
     */
    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
